package com.chj.listeners;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

@Component
public class TestListener {

	protected final Logger logger = LoggerFactory.getLogger(this.getClass());

	@KafkaListener(id = "1", topics = { "test" }, group = "test-group")
	public void test1(ConsumerRecord<?, ?> record) {
		logger.info("kafka Consumer ----test------> topic: {}, key: {},  value: {}", record.topic(), record.key(), record.value().toString());
	}

	@KafkaListener(id = "2", topics = { "test1" })
	public void test2(ConsumerRecord<?, ?> record) {
		logger.info("kafka Consumer -----test1------> topic: {}, key: {},  value: {}", record.topic(), record.key(), record.value().toString());
	}
	
//	@KafkaListener(id = "3", topics = { "daap_topic_test" })
//	public void test3(ConsumerRecord<?, ?> record) {
//		logger.info("kafka Consumer -----daap_topic_test------> topic: {}, key: {},  value: {}", record.topic(), record.key(), record.value().toString());
//	}

}
